<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateClientTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>

                <p:growl id="growl" sticky="true" showDetail="true"/>  

                <p:wizard widgetVar="wiz"  
                          flowListener="#{clientWizardController.onFlowProcess}">  

                    <p:tab id="personal" title="Personal">  

                        <p:panel header="Personal Details">  

                            <h:messages errorClass="error"/>  

                            <p:panelGrid columns="2" columnClasses="label, value" styleClass="grid">  
                                <h:outputText value="Nome: *" />  
                                <p:inputText required="true" label="Name"  
                                             value="#{clientWizardController.user.name}" />  

                                <h:outputText value="Login: *" />  
                                <p:inputText required="true" label="Login"  
                                             value="#{clientWizardController.user.login}" />  

                                <h:outputText value="Senha: " />  
                                <p:password value="#{clientWizardController.user.senha}" required="true" label="Senha" />  


                            </p:panelGrid>  
                        </p:panel>  
                    </p:tab>  

                    <p:tab id="address" title="Address">  
                        <p:panel header="Adress Details">  

                            <h:messages errorClass="error"/>  

                            <p:panelGrid columns="2" columnClasses="label, value">  
                                <h:outputText value="Rua: " />  
                                <p:inputText value="#{clientWizardController.add.street}" />  

                                <h:outputText value="Cidade: " />  
                                <p:inputText value="#{clientWizardController.add.city}" />  

                                <h:outputText value="Estado ou Provincia: " />  
                                <p:inputText value="#{clientWizardController.add.stateORprovince}" />  

                                <h:outputText value="Codigo Postal: " />  
                                <p:inputText value="#{clientWizardController.add.postalCode}" />  

                                <h:outputText value="País: " />  
                                <p:inputText value="#{clientWizardController.add.contry}" />  



                            </p:panelGrid>  
                        </p:panel>  
                    </p:tab>  



                    <p:tab id="confirm" title="Confirmation">  
                        <p:panel header="Confirmation">  

                            <p:panelGrid id="confirmation" columns="4">  
                                <h:outputText value="Name: " />  
                                <h:outputText styleClass="outputLabel"  
                                              value="#{clientWizardController.user.name}" />  

                                <h:outputText value="Login: " />  
                                <h:outputText  styleClass="outputLabel"  
                                               value="#{clientWizardController.user.login}"/>  

                                <h:outputText value="Rua: " />  
                                <h:outputText styleClass="outputLabel"  
                                              value="#{clientWizardController.add.street}" />  

                                <h:outputText value="Codigo Postal: " />  
                                <h:outputText styleClass="outputLabel"  
                                              value="#{clientWizardController.add.postalCode}" />  

                                <h:outputText value="City: " />  
                                <h:outputText styleClass="outputLabel"  
                                              value="#{clientWizardController.add.city}" />  

                                <h:outputText value="País: " />  
                                <h:outputText styleClass="outputLabel"  
                                              value="#{clientWizardController.add.contry}" />  

                                <h:outputText value="Estado ou Provincia: " />  
                                <h:outputText styleClass="outputLabel"  
                                              value="#{clientWizardController.add.stateORprovince}"/>  


                                <h:outputText />  
                                <h:outputText />  


                            </p:panelGrid>  

                            <f:facet name="footer">
                                <p:commandButton value="Submit" update="growl" actionListener="#{clientWizardController.save}"/> 
                            </f:facet>

                        </p:panel>  
                    </p:tab>  

                </p:wizard>  


            </h:form>
        </ui:define>
    </ui:composition>

</html>
